﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BF.Infrastructure
{
    /// <summary>
    /// 分页参数辅助类
    /// </summary>
    [Serializable]
    public class PageModel
    {
        int _pageSize = 15;

        int _currentPageIndex;

        public PageModel(int _pageIndex)
        {
            CurrentPageIndex = _pageIndex - 1;
        }

        public PageModel(int _pageIndex, int _pageSize)
        {
            CurrentPageIndex = _pageIndex - 1;
            this.PageSize = _pageSize;
        }

        public int RecordCount
        {
            get;
            set;
        }

        public int StartRecord
        {
            get
            {
                return CurrentPageIndex * PageSize;
            }
        }

        public int PageSize
        {
            get
            {
                return _pageSize;
            }
            set
            {
                this._pageSize = value;
            }
        }

        /// <summary>
        /// 当天分页页码
        /// </summary>
        public int CurrentPageIndex
        {
            get { return _currentPageIndex; }
            set { _currentPageIndex = value; }
        }
    }
}
